﻿// =================================================================== 
// 项目说明
//====================================================================
// lsc @Copy Right 2019
// 文件： VehicleRemindRepository.cs
// 项目名称：斑马车务
// 创建时间：2019/10/21
// 负责人：lsc
// ===================================================================
using System;
using System.Text;
using System.Collections.Generic;
using YouWei.Infrastructure.Entity;

namespace YouWei.Infrastructure.Repository
{
	/// <summary>
	/// 仓储层
	/// </summary>	
	public class VehicleRemindRepository:BaseRepository<VehicleRemind>
	{		
    
        #region 构造

        public VehicleRemindRepository() : base(){}

        public VehicleRemindRepository(string connectionString) : base(connectionString){}

        public VehicleRemindRepository(DatabaseContext dbContext) : base(dbContext){}

        #endregion

        /// <summary>
        /// 根据行驶证ID获取提醒信息
        /// </summary>
        /// <param name="mobile"></param>
        /// <returns></returns>
        public VehicleRemind GetInfoByVehicleID(int vehID)
        {
            StringBuilder sb = new StringBuilder("SELECT * FROM VehicleRemind T WITH(NOLOCK) ");
            sb.Append(" WHERE T.VehicleLicenseID = @VehicleLicenseID and T.IsActive=1");
            return FirstOrDefault(sb.ToString(), new { VehicleLicenseID = vehID });
        }
    }
}